import {getSearch} from "@/api";

const actions = {
    async querySearch({commit}, param) {
        const searchList = await getSearch(param);
        if (searchList.code == 200) {
            commit('saveSearch', searchList.data)
        }
    }
}
const mutations = {
    saveSearch(state, searchList) {
        state.searchList = searchList
    }
}
const state = {
    searchList: {}
}
const getters = {
    trademarkList(state) {
        return state.searchList.trademarkList
    }, attrsList(state) {
        return state.searchList.attrsList
    }, goodsList(state) {
        return state.searchList.goodsList
    },
}

export default {
    namespaced: true, actions, state, mutations, getters
}